/**
/**
 * JAVACC DEMO 1.0
 */

package freemarker.core;

import java.io.IOException;

import freemarker.core.Environment;
import freemarker.core.TemplateElement;
import freemarker.template.TemplateException;

/**
 * description:  
 * @author Hou Dayu 创建时间：2016-7-28
 */
public class MixedContentWrapper extends TemplateElement {

	MixedContent mixedContent;

	public MixedContentWrapper(MixedContent mixedContent) {
		this.mixedContent = mixedContent;
	}

	void accept(Environment env) throws TemplateException, IOException {
		EnvironmentWrapper environmentWrapper = new EnvironmentWrapper(env);
		for (int i = 0; i < mixedContent.nestedElements.size(); i++) {
			TemplateElement element = (TemplateElement) mixedContent.nestedElements.get(i);
			environmentWrapper.visit(element);
		}

	}

	public String getDescription() {
		return mixedContent.getDescription();
	}

	public String getCanonicalForm() {
		return mixedContent.getCanonicalForm();
	}

}
